import { map as f } from './common/map.js';
import { nullTag as u } from './common/null.js';
import { seq as s } from './common/seq.js';
import { string as b } from './common/string.js';
import { boolTag as k } from './core/bool.js';
import { float as $, floatExp as j, floatNaN as A } from './core/float.js';
import { int as O, intHex as N, intOct as x } from './core/int.js';
import { schema as E } from './core/schema.js';
import { schema as T } from './json/schema.js';
import { binary as p } from './yaml-1.1/binary.js';
import { omap as y } from './yaml-1.1/omap.js';
import { pairs as l } from './yaml-1.1/pairs.js';
import { schema as i } from './yaml-1.1/schema.js';
import { set as c } from './yaml-1.1/set.js';
import {
  timestamp as g,
  floatTime as J,
  intTime as S,
} from './yaml-1.1/timestamp.js';
const e = /* @__PURE__ */ new Map([
    ['core', E],
    ['failsafe', [f, s, b]],
    ['json', T],
    ['yaml11', i],
    ['yaml-1.1', i],
  ]),
  n = {
    binary: p,
    bool: k,
    float: $,
    floatExp: j,
    floatNaN: A,
    floatTime: J,
    int: O,
    intHex: N,
    intOct: x,
    intTime: S,
    map: f,
    null: u,
    omap: y,
    pairs: l,
    seq: s,
    set: c,
    timestamp: g,
  },
  P = {
    'tag:yaml.org,2002:binary': p,
    'tag:yaml.org,2002:omap': y,
    'tag:yaml.org,2002:pairs': l,
    'tag:yaml.org,2002:set': c,
    'tag:yaml.org,2002:timestamp': g,
  };
function Q(m, a) {
  let r = e.get(a);
  if (!r)
    if (Array.isArray(m)) r = [];
    else {
      const o = Array.from(e.keys())
        .filter(t => t !== 'yaml11')
        .map(t => JSON.stringify(t))
        .join(', ');
      throw new Error(
        `Unknown schema "${a}"; use one of ${o} or define customTags array`,
      );
    }
  if (Array.isArray(m)) for (const o of m) r = r.concat(o);
  else typeof m == 'function' && (r = m(r.slice()));
  return r.map(o => {
    if (typeof o != 'string') return o;
    const t = n[o];
    if (t) return t;
    const h = Object.keys(n)
      .map(w => JSON.stringify(w))
      .join(', ');
    throw new Error(`Unknown custom tag "${o}"; use one of ${h}`);
  });
}
export { P as coreKnownTags, Q as getTags };
